<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
	$tennhasanxuat = $_POST["tennhasanxuat"];
	$giaTu = $_POST["giaTu"];
	$giaDen = $_POST["giaDen"];
	$sql = "SELECT * FROM dt";
	$result = DataProvider::ExecuteQuery($sql);
	while ($row = mysql_fetch_array($result))
	{
		if ($tennhasanxuat == -1 && $giaTu == -1 && $giaDen == -1)
		{
			echo "<font style='font-size: 25px;'>Chưa nhập thông tin!</font>";
			exit(); 
		}
		if ($row["manhasanxuat"] == $tennhasanxuat && $giaTu == -1 && $giaDen == -1)
		{
			?>
			<div class="boderDT">
	<div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    		<img src="<?php echo $row["hinh"]; ?>" width="80" height="120" />
        </a>
    </div>
    <div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    	<?php echo $row["tendt"]; ?></a>
    </div>
    <div>
    	<font color="#FF0000">Giá: <?php echo number_format ($row["gia"],0); ?>vnd</font>
    </div>
</div>
			<?php
		} 
		if ($giaTu != -1 && $giaDen != -1 && $giaDen <= $giaTu )
		{		
			echo "<font style='font-size: 25px;'>Giá đến phải lớn hơn giá từ!</font>";
			exit();
		}
		if ($giaTu != -1 && $giaDen == -1)
		{
			echo "<font style='font-size: 25px;'>Chưa chọn giá đến!</font>";
			exit();
		}
		if ($giaTu == -1 && $giaDen != -1)
		{
			echo "<font style='font-size: 25px;'>Chưa chọn giá từ!</font>";
			exit();
		}
		if ($row["manhasanxuat"] == $tennhasanxuat && $row["gia"] > $giaTu && $row["gia"] < $giaDen && $giaTu != -1 && $giaDen != -1)
		{
			?><div class="boderDT">
	<div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    		<img src="<?php echo $row["hinh"]; ?>" width="80" height="120" />
        </a>
    </div>
    <div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    	<?php echo $row["tendt"]; ?></a>
    </div>
    <div>
    	<font color="#FF0000">Giá: <?php echo number_format ($row["gia"],0); ?>vnd</font>
    </div>
</div>	<?php
		}
		if ($tennhasanxuat == -1 && $row["gia"] > $giaTu && $row["gia"] < $giaDen)
		{
			?><div class="boderDT">
	<div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    		<img src="<?php echo $row["hinh"]; ?>" width="80" height="120" />
        </a>
    </div>
    <div>
    	<a href="index.php?act=4&id=<?php echo $row["madt"]; ?>">
    	<?php echo $row["tendt"]; ?></a>
    </div>
    <div>
    	<font color="#FF0000">Giá: <?php echo number_format ($row["gia"],0); ?>vnd</font>
    </div>
</div> 			
			<?php
		}
		
	}
?>